package hfjava;

import java.util.Arrays;

public class Demo_4 {
    public static void main(String[] args) {
        int[] newArr={1,3,4,5,0,0,6,6,0,5,4,7,6,7,0,5};
        int[] newArr1=new int[12];
        int j=0;
        for (int i = 0; i <newArr.length ; i++) {
            if (newArr[i]==0){
                continue;
            }else{
                newArr1[j]=newArr[i];
                j++;
            }
        }
       System.out.println(Arrays.toString(newArr1));
    }
}
